Stanley tracker

Stanley controller was used in the DARPA-challenge winning autonomous vehicle, back in the day. It is a non-linear controller, which explicitly takes into account ref_theta unlike pure pursuit. Because it was used for a car, a bicycle model is to be used for vehicular motion

Trackers are trying to minimize 2 types of errors

  1. Positional error or cross-track error $x_e$

  2. Heading error $\theta_e$

Tracker controls the steering as a function of these 2 errors

$\delta = \theta_e + \tan^{-1}\frac{kx_e}{v}$

The second term can be thought of as how quickly do we want the vehicle to compensate for the positional error relative to vehicle velocity

Snider has a nice/ concise summary of how it works in Sec 2.3 of his Phd thesis https://www.ri.cmu.edu/pub_files/2009/2/Automatic_Steering_Methods_for_Autonomous_Automobile_Path_Tracking.pdf

There is a reference implementation here https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/stanley_controller/stanley_controller.py